home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 8
/
Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO
/
047a
/
probots.arj
/
NINJA2.PR
< prev
next >
Wrap
Text File
|
1988-11-05
|
1KB
|
62 lines
PROCEDURE Ninja2;
{ Based on a C-Robot by Hortense Endoh }
VAR
dir, deg, Range, spd, cnt : Integer;
PROCEDURE shoot;
BEGIN
drive(dir, spd);
Range := scan(deg, 10);
IF (Range > 40)
THEN cannon(deg, Range)
ELSE BEGIN
deg := deg+20;
Range := scan(deg, 10);
IF (Range = 0) THEN
BEGIN
deg := deg-40;
Range := scan(deg, 10);
IF (Range = 0) THEN
BEGIN
deg := deg+60;
Range := scan(deg, 10);
WHILE (Range = 0) DO
BEGIN
deg := deg+20;
Range := scan(deg, 10);
END;
END;
END;
IF (Range > 40) THEN cannon(deg, Range);
END;
END; {Shoot}
BEGIN {Main Ninja2}
spd := 100;
deg := 90;
dir := 270;
WHILE (loc_y > 500) DO shoot;
dir := 90;
WHILE (loc_y < 500) DO shoot;
REPEAT {until dead or winner}
cnt := 10;
WHILE (cnt > 0) DO
BEGIN
dir := deg;
shoot;
cnt := cnt-1;
END;
deg := deg+3;
dir := 270;
WHILE (loc_y > 290) DO shoot;
dir := 0;
WHILE (loc_x < 710) DO shoot;
UNTIL Dead OR Winner;
END; {Main Ninja}